package com.neudu.glsb.mapper;

import com.neudu.glsb.pojo.UserOperationLogs;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
* @author Lenovo
* @description 针对表【user_operation_logs(记录用户操作日志)】的数据库操作Mapper
* @createDate 2025-04-16 22:28:32
* @Entity com.neudu.glsb.pojo.UserOperationLogs
*/
@Mapper
public interface UserOperationLogsMapper extends BaseMapper<UserOperationLogs> {
        @Select("SELECT " +
                "uol.id, " +
                "uol.user_id, " +
                "uol.operation_time, " +
                "uol.operation_type, " +
                "uol.operation_detail, " +
                "e.employee_name " +
                "FROM user_operation_logs uol " +
                "LEFT JOIN admin_users au ON uol.user_id = au.id " +
                "LEFT JOIN employees e ON au.id = e.admin_user_id " +
                "WHERE uol.operation_time BETWEEN #{startDate} AND #{endDate}")
        List<UserOperationLogs> getLogsByDateWithEmployeeName(
                @Param("startDate") Date startDate,
                @Param("endDate") Date endDate);
    }



